package com.loren.demo13.mapper;

import com.loren.demo13.data_permission.DataPermission;
import com.loren.demo13.data_permission.DataPermissionMapper;
import com.loren.demo13.data.entity.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ArticleMapper extends DataPermissionMapper<Article> {

    @Select({
            "select t0.id, t0.title, t0.content, t1.name",
            "from article t0",
            "left join category t1 on t1.id = t0.category_id",
            "where t0.id = 1"
    })
    @DataPermission
    List<Map<String, Object>> selectAll();
}
